package ru.arriah.servicedesk.ejb;

import java.util.Collection;
import javax.ejb.EJBLocalObject;
import ru.arriah.servicedesk.bean.EmployeeBean;
import ru.arriah.servicedesk.bean.EmployeeTypeBean;

public interface EmployeeManagerLocalObject extends EJBLocalObject {
  public int authorize(String login, String password, int employeeType);
  public Collection<EmployeeBean> selectByGroupId(int groupId);
  public Collection<EmployeeBean> selectAll();
  public Collection<EmployeeBean> selectAll(
    String orderBy,
    String order,
    String status
  );
  public int selectLeadExecutorId(int groupId);
  
  public Collection<EmployeeBean> selectSubordinates(int userId);
  public Collection<EmployeeBean> selectNotSubordinates(
    int userId
  );
  
  public EmployeeBean selectDispatcher();
  
  public boolean restoreEmployee(int id);
  public boolean deleteEmployee(int id);
  
  public Collection<EmployeeTypeBean> selectEmployeeTypes();
  public EmployeeBean selectEmployee(int employeeId);
  
  public boolean updateEmployee(EmployeeBean employeeBean);
  public boolean addEmployee(EmployeeBean employeeBean);
  
  public boolean isLoginUnique(String login, int type, int id);
  
  public boolean addSubordinate(int ownerId, int subordinateId);
  public boolean deleteSubordinate(int ownerId, int subordinateId);
  public Collection<EmployeeBean> selectLeadExecutors();
}